﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Library;

namespace QLKH.PopUp.vattu
{
    public partial class popThemTuyen : Form
    {
        public popThemTuyen()
        {
            InitializeComponent();
        }

        public delegate void Themtuyen(int outid);
        // khai báo 1 kiểu hàm delegate
        public Themtuyen MyFunction;

        private void btquit_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btsave_Click(object sender, EventArgs e)
        {
            if (MyFunction != null)
            {// tại đây gọi nó
                string ten = txtTuyen.Text.Trim();

                clTuyen clt = new clTuyen();
                int outid = clt.add_tuyen(ten);
                MyFunction(outid);
            }
            this.Close();
        }
    }
}
